<?php
function Error_Alert($message = '', $after_action = '', $url = '',$type='Alert',$width=280,$height=150,$isframe=0){
   
	
	$out="<script language=\"javascript\" type=\"text/javascript\">\n";
    $out.="function okFunc(){\n";
    if (!empty($after_action)) {
        $out .=$after_action . "\n";
    }
    if (!empty($url)) {
        $out .= "document.location.href=\"";
        $out .= $url;
        $out .= "\";";
    }
    $out.="}\n</script>\n";
    
    //$out.= "<link href=\"style/master.css\" rel=\"stylesheet\" type=\"text/css\" />\n";
    $out.= "<script type=\"text/javascript\" src=\"/libs/ymjs/ymPrompt.js\"></script>\n";
    if($isframe){
    $out.= "<script type=\"text/javascript\" src=\"/libs/ymjs/ymPromptEx.js\"></script>\n"; 
    }
    $out.="<script language=\"javascript\" type=\"text/javascript\">\n
    __ymPrompt_skin='Default';\n
    ";
    if (!empty($message)) {
        $out .= "$type(\"".str_replace("\\\\n", "\\n", t2js(addslashes($message)))."\",$width,$height,\"".str_replace("\\\\n", "\\n", t2js(addslashes($message)))."\",okFunc,null);</script>";
        //$out.="Alert('Success', 280, 150, 'Message');</script>";
    }
    echo $out;
    exit;
}

?>